package org.zjx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.zjx.dao.entity.Npc;
import org.zjx.dao.entity.Prop;
import org.zjx.dao.mapper.NpcMapper;

import java.util.Collections;

/**
 * <p>
 * npc属性 服务实现类
 * </p>
 *
 * @author 
 * @since 2025-05-30
 */
@Service
public class NpcServiceImpl extends ServiceImpl<NpcMapper, Npc> implements INpcService {

    @Override
    public Npc getNpcByName(String name) {
        if (name == null || name.isEmpty()) {
            return null;
        }
        // 构建查询条件（根据实际列名选择方案一/二）
        QueryWrapper<Npc> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("name", name);

        // 执行查询
        return baseMapper.selectOne(queryWrapper);
    }
}
